<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			.box{
				width: 100%;
				height: 300px;
				background: red;
			}
		</style>
		<script type="text/javascript">
			window.onload=function(){
				var oDiv=document.getElementsByTagName('div')[0];
				var oSpan=document.getElementsByTagName('span')[0];
				var timer=setInterval(function(){
					oSpan.innerHTML=oSpan.innerHTML-1;
					if(parseInt(oSpan.innerHTML)==0){
						oDiv.style.display='none';
						clearInterval(timer);
						return false;
					}
				},1000)
				
			}
		</script>
	</head>
	<body>
		<div class="box">
			离关闭还有<span>5</span>秒
		</div>
	</body>
</html>
